package com.tm.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@ApiModel(value = "用户的实体类",description = "用户的实体类")
@HeadRowHeight(value = 55)
@ContentRowHeight(value = 45)
public class Person {

    @ApiModelProperty(value = "用户的id",required = true ,dataType = "number")
    @TableId(type = IdType.AUTO)
    @ExcelProperty(value = {"用户信息","编号"},order = 1)
    private int personId;
    @ApiModelProperty(value = "用户的名称",required = true ,dataType = "String")
    @ExcelProperty(value = {"用户信息","名称"},order = 111)
    private String personName;

    @ApiModelProperty(value = "用户的入职时间",required = true ,dataType = "data")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ExcelProperty(value = {"用户信息","入职时间"},order = 2)
    @com.alibaba.excel.annotation.format.DateTimeFormat("yyyy-MM-dd HH:mm:ss" )
    private Date personDate;        //入职时间

    @ApiModelProperty(value = "用户的工龄",required = true ,dataType = "number")
    @ExcelIgnore
    @ExcelProperty(value = {"用户信息","工龄"},order = 3)
    private Integer personAge;       //工龄

    @ApiModelProperty(value = "用户的性别",required = true ,dataType = "number")
    @ExcelProperty(value = {"用户信息","性别"},order = 4)
    @ExcelIgnore
    private Character personSex;    //0男 1女

    @ApiModelProperty(value = "用户的微信号",required = true ,dataType = "number")
    @ExcelProperty(value = {"用户信息","微信号"},order = 5)
    private String weChatNumber;    //微信号

    @ApiModelProperty(value = "用户的手机号",required = true ,dataType = "number")
    @ExcelProperty(value = {"用户信息","手机号"},order = 6)
    private String phoneNumber;     //手机号

    @ApiModelProperty(value = "用户的岗位",required = true ,dataType = "number")
    @ExcelProperty(value = {"用户信息","用户岗位"},order = 7)
    private Integer stationId;      //用户岗位

    @ApiModelProperty(value = "用户生日",required = true ,dataType = "data")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @ExcelProperty(value = {"用户信息","用户生日"},order = 8)
    @com.alibaba.excel.annotation.format.DateTimeFormat("yyyy-MM-dd HH:mm:ss" )
    private Date birthday;          //用户生日

    @ApiModelProperty(value = "用户头像路径",required = true ,dataType = "String")
    @ExcelProperty(value = {"用户信息","头像路径"},order = 9)
    private String imgUrl;          //头像路径

    @ApiModelProperty(value = "用户民族",required = true ,dataType = "number")
    @ExcelIgnore
    private Character nation;          //民族     0汉族 1其他

    @ExcelIgnore
    @TableField(exist = false)
    private List<Role> roleList;

    public void setPersonId(int personId) {
        this.personId = personId;
    }

    public List<Role> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<Role> roleList) {
        this.roleList = roleList;
    }

    public Integer getPersonId() {
        return personId;
    }

    public void setPersonId(Integer personId) {
        this.personId = personId;
    }

    public String getPersonName() {
        return personName;
    }

    public void setPersonName(String personName) {
        this.personName = personName;
    }

    public Date getPersonDate() {
        return personDate;
    }

    public void setPersonDate(Date personDate) {
        this.personDate = personDate;
    }

    public Integer getPersonAge() {
        return personAge;
    }

    public void setPersonAge(Integer personAge) {
        this.personAge = personAge;
    }

    public Character getPersonSex() {
        return personSex;
    }

    public void setPersonSex(Character personSex) {
        this.personSex = personSex;
    }

    public String getWeChatNumber() {
        return weChatNumber;
    }

    public void setWeChatNumber(String weChatNumber) {
        this.weChatNumber = weChatNumber;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Integer getStationId() {
        return stationId;
    }

    public void setStationId(Integer stationId) {
        this.stationId = stationId;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public Character getNation() {
        return nation;
    }

    public void setNation(Character nation) {
        this.nation = nation;
    }
}
